      SUBROUTINE KURV2 ( T, XS, YS, N, X, Y, XP, YP, S, SIGMA )
C*
C*               *********************************************
C*               *                                           *
C*               *                    KURV2                  *
C*               *                                           *
C*               *********************************************
C*
C*      KURV2 - EVALUATE THE INTERMEDIATE POINTS FOR THE CURVE
C*           DETERMINED BY ROUTINE KURV1.
C*
C*      AUTHOR - A. K. CLINE
C*               NATIONAL CENTER FOR ATMOSPHERIC RESEARCH
C*               PO BOX 1470
C*               BOULDER, COLORADO   80302
C*
C*      CODED BY - A. E. RAGOSTA     415-694-6235
C*               TR18
C*               AMES RSCH CTR
C*               MOFFETT FIELD, CALIF  94035
C*
C*      INPUT ARGUMENTS
C*           T      - LOCATION ON CURVE NORMALIZED FROM 0. TO 1.
C*           N      - NUMBER OF POINTS IN ARRAYS
C*           X      - INDEPENDENT VALUES ARRAY
C*           Y      - DEPENDENT VALUES ARRAY
C*           XP     - INFORMATION PASSED FROM KURV1
C*           YP     - INFORMATION PASSED FROM KURV1
C*           SIGMA  - TENSION FACTOR
C*
C*      OUTPUT ARGUMENTS
C*           XS     - CALCULATED X VALUE FOR T
C*           YS     - CALCULATED Y VALUE FOR T
C*
C*      COMMON BLOCKS REFERENCED :
C*           NONE
C*
C*      FILES REFERENCED :
C*           NONE
C*
C*     EXTERNAL SUBPROGRAMS REFERENCED :
C*          SQRT, EXP, ABS, FLOAT
C*
C*      VERSION I      29 DEC 1981
C*
C***********************************************************************
C*
      DIMENSION X(N), Y(N), XP(N), YP(N)
C
      SIGMAP = ABS ( SIGMA ) * FLOAT (N-1) / S
      TN     = ABS ( T * S )
C
C --- IF T < 0 CONTINUE FROM LAST POINT
C
      IF ( T .LT. 0. ) GO TO 10
      I1   = 2
      XS   = X(1)
      YS   = Y(1)
      SUM  = 0.
      IF ( T .LE. 0 ) RETURN
C
C --- DETERMINE WHICH SEGMENT WE ARE IN
C
   10 DO 30 I = I1, N
         DELX = X(I) - X(I-1)
         DELY = Y(I) - Y(I-1)
         DELS = SQRT ( DELX**2 + DELY**2 )
         IF (( SUM + DELS - TN ) .GE. 0. ) GO TO 40
         SUM  = SUM + DELS
   30    CONTINUE
C
C --- IF T > 1, RETURN LAST POINT IN ARRAY
C
      XS = X(N)
      YS = Y(N)
      RETURN
C
C --- INTERPOLATION
C
   40 DEL1   = TN - SUM
      DEL2   = DELS - DEL1
      EXPS1  = EXP ( SIGMAP * DEL1 )
      SINHD1 = .5 * ( EXPS1 - 1./EXPS1 )
      EXPS   = EXP ( SIGMAP * DEL2 )
      SINHD2 = .5 * ( EXPS - 1./EXPS )
      EXPS   = EXPS1 * EXPS
      SINHS  = .5 * ( EXPS - 1./EXPS )
      XS     = ( XP(I) * SINHD1 + XP(I-1) * SINHD2 ) / SINHS +
     $ (( X(I) - XP(I)) * DEL1 + ( X(I-1) - XP(I-1)) * DEL2 ) / DELS
      YS     = ( YP(I) * SINHD1 + YP(I-1) * SINHD2 ) / SINHS +
     $ (( Y(I) - YP(I)) * DEL1 + ( Y(I-1) - YP(I-1)) * DEL2 ) / DELS
      I1     = I
      RETURN
      END
C
C---END KURV2
C
